<template>
  <div>
    <p>
      <input type="text" v-model="msg">
    </p>
    <p>
      原生写法:原生元素(自定义组件)<br>
      <input type="text" :value="msg" @input="update">
    </p>
    组件一
    <p>
      自定义组件:
      <modelTest v-model="msg"></modelTest>
    </p>
    组件二
    <p>
      <modelTest2Vue v-model="count" v-model:price="price"></modelTest2Vue>
    </p>
  </div>
</template>

<script setup>
import modelTest from './components/v-modelTest.vue'
import modelTest2Vue from './components/modelTest2.vue';
import { ref } from 'vue';
const msg = ref('')
const count = ref(10)
const price = ref(20)
const update = (e) =>{
  msg.value = e.target.value
}
</script>